{% extends "base.html" %}

{% block content %}
{% if request.user.is_authenticated %}
    {% if answered_questions %}
        {% for q in answered_questions %}
            {{ q.answer }} <a href="{% url edit input_id=q.question.id%}">(Change Answer)</a>

        <br />
        <br />
        
        {% endfor %}
    {% else %}
        <p>No questions have been answered.</p>
    {% endif %}
{% else %}
    {% if answered_questions %}
    {% for a in answered_questions %}
       {{ a }} <a href="/questions/{{ a.id }}/edit">(Change Answer)</a>
        <br />
        <br />    
    {% endfor %}
    {% else %}
    <p>No questions have been answered.</p>
    {% endif %}
{% endif %}
{% endblock %}
